export default {
	/**
	 * 小数点前字体调整
	 */
	priceStyle(str) {
		str = str + ''
		if(!isNaN(str)){
			str = ( str.indexOf('.') != -1 ) ? str: str+'.00';   
		}
		let splitPrice = str.split(".")
		return `￥<span class="price-style" style="font-family: 'Din';">${splitPrice[0]}</span>.${splitPrice[1]}`
	},
}

export function getNetworkType() {
	return new Promise((resolve, reject) => {
		uni.getNetworkType({
			success(res) {
				resolve(res.networkType);
			},
			fail(err) {
				reject();
			}
		});
	})
};

export function goReturn(delta = 1) {
	uni.navigateBack({
		delta
	});
}
